home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue52 / HTML / Code / AppServer / SML_Handler.dpr < prev    next >
Encoding:
Text File  |  1999-10-24  |  1.6 KB  |  60 lines

  1. program SML_Handler;
  2.  
  3. uses
  4.   Forms,
  5.   SysUtils,
  6.   svrMain in 'svrMain.pas' {frmMain},
  7.   SML_Handler_TLB in 'SML_Handler_TLB.pas',
  8.   svrCOMmain in 'svrCOMmain.pas' {SMLHandler: CoClass},
  9.   svrPageHandler in 'svrPageHandler.pas',
  10.   mleSMLContainer in 'mleSMLContainer.pas',
  11.   dpoEmployee in 'dpoEmployee.pas',
  12.   dpoCustomer in 'dpoCustomer.pas',
  13.   dpoBase in 'dpoBase.pas' {DataObject: TDataModule},
  14.   mleCommon in 'mleCommon.pas',
  15.   usXMLDoc in 'usXMLDoc.pas',
  16.   mleTagResolvers in 'mleTagResolvers.pas',
  17.   UHTTPApp in 'UHTTPApp.pas',
  18.   svrSubmitHandler in 'svrSubmitHandler.pas',
  19.   svrCommon in 'svrCommon.pas',
  20.   mleDataBindings in 'mleDataBindings.pas',
  21.   dpoEvent in 'dpoEvent.pas' {Event: TDataModule},
  22.   mlePropertyInfo in 'mlePropertyInfo.pas',
  23.   mleObjectCache in 'mleObjectCache.pas';
  24.  
  25. {$R *.TLB}
  26.  
  27. {$R *.RES}
  28.  
  29. type
  30.   TExceptionHandler = class
  31.   public
  32.     InExceptionState: Boolean;
  33.     procedure HandleException(Sender: TObject; E: Exception);
  34.   end;
  35.  
  36. var
  37.   ExceptionHandler: TExceptionHandler;
  38.  
  39. { TExceptionHandler }
  40.  
  41. procedure TExceptionHandler.HandleException(Sender: TObject; E: Exception);
  42. begin
  43.   LogEvent(etError, 1, E.Message);
  44.   InExceptionState := True;
  45. end;
  46.  
  47. begin
  48.   ExceptionHandler := TExceptionHandler.Create;
  49.   try
  50.     Application.OnException := ExceptionHandler.HandleException;
  51.     Application.Initialize;
  52.     Application.CreateForm(TfrmMain, frmMain);
  53.   Application.CreateForm(TEvent, Event);
  54.   if ExceptionHandler.InExceptionState then Exit;
  55.     Application.Run;
  56.   finally
  57.     ExceptionHandler.Free;
  58.   end;
  59. end.
  60.